<template>
  <div class="bottom-nav">
    <div class="bottom-item item-left">
      <div>
        <i class="icon service"></i>
        <span class="text">客服</span>
      </div>
      <div>
        <i class="icon shop"></i>
        <span class="text">店铺</span>
      </div>
      <div>
        <i class="icon select"></i>
        <span class="text">收藏</span>
      </div>
    </div>
    <div class="bottom-item item-right">
      <div class="cart" @click="addToCart">加入购物车</div>
      <div class="buy">购买</div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'DetailBottomNav',
  data() {
    return {}
  },
  methods: {
    addToCart() {
      //事件发送出去
      this.$emit('addToCart')
    }
  }
}
</script>

<style type="text/css" scoped>
.bottom-nav {
  height: 49px;
  display: flex;
  background: #f6f6f6;
  box-shadow: 0 -1px 1px rgba(0, 0, 0, 0.1),
    0 2px 1px rgba(155, 156, 155, 0.1) inset;
}
.bottom-item {
  display: flex;
  flex: 1;
  text-align: center;
  align-items: center;
}
.bottom-item > div {
  flex: 1;
}
.item-left .text {
  font-size: 13px;
}
.item-left .icon {
  display: block;
  width: 22px;
  height: 22px;
  margin: 5px auto 1px;
  background: url('~assets/images/detail/detail_bottom.png') 0 0/100%;
}
.item-left .service {
  background-position-y: -54px;
}
.item-left .shop {
  background-position-y: -98px;
}
.item-right {
  font-size: 15px;
  color: #fff;
  line-height: 49px;
}
.item-right .cart {
  background-color: #ffe817;
  color: #333;
  height: 100%;
}
.buy {
  height: 100%;
  background-color: #f69;
}
</style>
